
  

      
      <h2 style="margin-bottom:20px;"><?php echo $team->team_name." (".$team->team_shortname.")";?></h2>
      <div class='row'>
          <div class='span4'>
            <div class='panel'>
              <h3><?php echo $team->team_name;?></h3>
              <p><?php echo sprintf(lang('team_total_points'), $team->team_name, $team_total_points);?></p>
              <?php if ($top_rider)
              {
              ?>
              <p>
              <?php echo sprintf(lang('top_team_rider'), $team->team_name, anchor('info/rider/'.$top_rider->rider_id, $top_rider->first_name." ".$top_rider->last_name));?>
            </p>
            <?php
              }
              ?>
            </div>
          </div>
          <div class='span8'>
            <div class='panel'>
        <table class='table table-condensed'>
          <thead>
            <tr>
              <th><?php echo lang('rider');?></th>
              <th class='centertext'><a href="#" rel="tooltip" title="<?php echo lang('stage_results');?>"><img src="<?php echo base_url();?>assets/images/jersey_stage.gif" /></a></th>
              <th class='centertext'><a href="#" rel="tooltip" title="<?php echo lang('overall_standing');?>"><img src="<?php echo base_url();?>assets/images/jersey_yellow.gif" /></a></th>
              <th class='centertext'><a href="#" rel="tooltip" title="<?php echo lang('points_standing');?>"><img src="<?php echo base_url();?>assets/images/jersey_green.gif" /></a></th>
              <th class='centertext'><a href="#" rel="tooltip" title="<?php echo lang('mountain_standing');?>"><img src="<?php echo base_url();?>assets/images/jersey_mountain.gif" /></a></th>
              <th class='centertext'><?php echo lang('total');?></th>
            </tr>
          </thead>
          <tbody>

        <?php $total_points = 0;?>
        <?php
        if(isset($riders))
        {
          foreach($riders as $rider)
          {
          ?>
            
          <?php    
            if (isset($rider) && is_object($rider))
            {
              $class="rider";
              if (!$rider->active)
              {
                $class .= " inactive";
              }
          ?>   
                <tr class="<?php echo $class;?>">
                  <td><?php echo $rider->number." ".
                  anchor('info/rider/'.$rider->rider_id,$rider->last_name." ".$rider->first_name); ?></td>
                  <td class='centertext'>
                    <?php
                    if(array_sum(explode(',',$rider->points_stage)) > 0 )
                    {
                      echo array_sum(explode(',',$rider->points_stage));
                    }
                    else
                    {
                      echo "-";
                    }?>
                  </td>
                  <td class='centertext'>
                   <?php
                    if(array_sum(explode(',',$rider->points_stage_yellow)) > 0 )
                    {
                      echo array_sum(explode(',',$rider->points_stage_yellow));
                    }
                    else
                    {
                      echo "-";
                    }?>
                  </td>
                  <td class='centertext'>
                   <?php
                    if(array_sum(explode(',',$rider->points_stage_green)) > 0 )
                    {
                      echo array_sum(explode(',',$rider->points_stage_green));
                    }
                    else
                    {
                      echo "-";
                    }?>
                  </td>                
                  <td class='centertext'>
                   <?php
                    if(array_sum(explode(',',$rider->points_stage_mountain)) > 0 )
                    {
                      echo array_sum(explode(',',$rider->points_stage_mountain));
                    }
                    else
                    {
                      echo "-";
                    }?>
                  </td>
                  <td class='centertext'>
                    <?php
                    if (array_sum(explode(',',$rider->points_stage)) + array_sum(explode(',',$rider->points_stage_yellow)) + array_sum(explode(',',$rider->points_stage_green)) + array_sum(explode(',',$rider->points_stage_mountain))>0)
                    {
                      echo array_sum(explode(',',$rider->points_stage)) + array_sum(explode(',',$rider->points_stage_yellow)) + array_sum(explode(',',$rider->points_stage_green)) + array_sum(explode(',',$rider->points_stage_mountain));
                    }
                    else
                    {
                      echo "-";
                    }                    
                    $total_points = $total_points + array_sum(explode(',',$rider->points_stage)) + array_sum(explode(',',$rider->points_stage_yellow)) + array_sum(explode(',',$rider->points_stage_green)) + array_sum(explode(',',$rider->points_stage_mountain));?>
                  </td>                  
                </tr>
           <?php
            }
          }
        } ?>
         </tbody>
           <tfoot>
            <tr>
                <td colspan='5' class='righttext'><?php echo lang('total').": ";?></td>
                <td class='centered'><?php echo $total_points;?></td>
            </tr>
          </tfoot>
        </table>           
            </div>
          </div>
      </div>
 